package com.cfilmcloud.learn.demo;

import com.cfilmcloud.learn.demo.use.SimpleFuncInterface;

import java.util.function.Function;

/**
 * Created by edz on 2017/7/13.
 */
public class DemoFunction {

    public static void main(String[] args) {

        final Runnable multiStatement = () -> {
            System.err.println("Hello");
            System.err.println("World");
        };

        multiStatement.run();

        System.err.println("**********************************************************************************");
        System.err.println("定义一个函数式接口");



        final SimpleFuncInterface simpleFuncInterface = str -> {
            return "标示：" + str;
        };

        System.err.println(simpleFuncInterface.doWork("worker001"));
        System.err.println(simpleFuncInterface.doWork("worker002"));
        System.err.println(simpleFuncInterface.doWork("worker003"));

        System.err.println("**********************************************************************************");

    }
}
